<template>
  <div>
    <h1>666</h1>
    <ul>
      <li v-for="i in data" @click="dian(i.id)" :class="i.id==pid? 'style':''">{{ i.name }}</li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['data', 'pid'],
  name: "subscate",
  data() {
    return {
      pid: 0
    }
  },
  methods: {
    dian(id) {
      this.pid = id

    }
  }
}
</script>

<style scoped>
.style {
  background-color: aqua;
}

</style>
